#include <stdio.h>

int main(int argc, char *argv[]) {

    int jobTime,salary;
    scanf("%d", &jobTime);
    if(jobTime>160){
        salary = (160*10)+(jobTime - 160)*30;
        printf("%d", salary);
    }else{
        salary = jobTime * 10;
        printf("%d", salary);
    }
    return 0;
}